<div class="photo_thumbnail">
  <!-- <% rel = logged_in? ? "lightbox" : "nil" %> -->
  <!-- <% url = logged_in? ? image_path(photo.to_url(:original)) : "#" %> -->
  <% url = logged_in? ? url_for(:controller=>"gallery", :action=>"view", :id=>photo) : "#" %>
  <% image = image_tag(photo.to_url(:thumbnail), :class=>"photo", :id=>"photo_#{photo.id}", :title=>photo.description) %>
  <div class="thumbnail">
    <%= link_to image, url %><br>
  </div>
  <b><%= photo.title %></b>
  <%if photo.created_at > 24.hours.ago -%><%= $new_img %><% end -%>&nbsp;(<%=photo.get_rate%>)<br>
  From <%= user_to_url photo.user %>
  <%= draggable_element "photo_#{photo.id}", :revert => true if logged_in? %>
</div>
